package week0501;


import java.util.*;


public class Main4{

	public static void main(String[] args) {
	   Scanner sc = new Scanner(System.in);
	   while(sc.hasNextLine()){
	       String line = sc.nextLine();
	       String result = null;
	       if(line.equals("null"))
	           result = extractBirthDate(null);
	       else
	           result = extractBirthDate(line);
	       if(result==null)
	           continue;
	       System.out.println(result);
	   }
	   sc.close();		
		
	}
	
	public static String extractBirthDate(String nextLine){
		if(nextLine==null)
			return null;
		nextLine=nextLine.replaceAll(" ", ""); 
		if(nextLine.length()!=18)
			return null;
		nextLine=nextLine.substring(6,10)+"-"+nextLine.substring(10,12)+"-"+nextLine.substring(12,14);
		return nextLine;
		
	}
}